1. Field of the Invention
The present invention relates to a data transmission/reception between units connected via a serial bus based on a daisy chain method.
2. Description of the Related Art
A data transmission/reception system linking a plurality of units via a daisy chain type serial bus to transmit/receive data among the units is known.
For example, in machine tools controlled by a numerical controller, a system where the numerical controller and a servo amplifier of a servo motor for driving each feed shaft are connected via a serial bus, and the position of a feed shaft and velocity data detected by each servo amplifier are sent to the numerical controller by the daisy chain method, is disclosed in Japanese Patent Application Laid-Open No. 10-13394 (hereafter referred to as Patent Document 1).
FIG. 1 shows an example of a data transmission/reception system of which units (servo amplifiers) are linked by a daisy chain type serial bus, as disclosed in the patent document 1.
The numerical controller 1 and a plurality of (three in this case) servo amplifiers (hereafter just referred to as amplifier) A1, A2 and A3 are connected in a daisy chain method via a serial bus cable 2. Each amplifier A1, A2 and A3 simultaneously sends data of each amplifier, such as the current value of the motor and the position/velocity information fed back from the position/velocity detector installed in the motor, to a unit (an amplifier or numerical controller) at the upstream side following a transmission start code, from a respective second connector C2 to a cable 2 of the serial bus on the side of the numerical controller 1 (or at the upstream side), so as to send the local data to the numerical controller 1. The amplifier data that each amplifier A1, A2 and A3 received from a unit (amplifier) at the downstream side via the first connector C1 is sent to a unit at the upstream side after the local amplifier data, and finally the numerical controller 1 receives data from all the amplifiers A1, A2 and A3 connected via the daisy chain method.
FIG. 2 shows a configuration example of a portion related to the data transmission/reception according to the present invention in the conventional amplifiers A1, A2 and A3. From a first connector C1, which is connected with a servo amplifier at a position most distant (downstream) from the numerical controller 1 via the serial bus cable 2, the amplifier data from the amplifier at the downstream side is received after the transmission start code. When the transmission start code is detected by a transmission code detection circuit 10, a transmission start code receive timing is notified to a receive control circuit 11, the receive control circuit 11 determines the delimit of the data based on a bit position from the transmission start code, and the data from the amplifier at the downstream side is delimited using this delimit of the data, and a receive buffer 12 is instructed to store this data.
From a second connector C2, on the other hand, transmission is started to a servo amplifier or the numerical controller 1 at the upstream side. Transmission is controlled by a transmission control circuit 15, and data to be sent is selected by a selector 14. The selector 14 first selects a transmission start code, then selects the data of an amplifier to be stored in an amplifier data storage section 13, and then selects data of other amplifiers stored in the receive buffer 12. A transmission circuit 16 sends the transmission start code and the amplifier data according to this selection sequence. The transmission start timing is simultaneous for each servo amplifier.
FIG. 3 is a diagram depicting serial data to be sent to the serial bus cable 2, and shows an example of serial data which is sent from an n-th amplifier An, counted from the side closer to the numerical controller 1 (upstream), to the serial bus cable 2. A transmission start code SC, which is a code to indicate the start of transmission, and each amplifier data DATAn, DATAn+1 and DATAn+2, are determined by the bit positions. In the example in FIG. 3, the transmission start code SC is delimited at 60 bits, and the amplifier data is delimited in 70 bit units. The amplifier data is delimited by 70 bits from the bit position next to the receive timing of the transmission start code SC, so that local amplifier data DATAn, and then DATAn+1 and DATAn+2 which were sent from the servo amplifiers at the downstream side, are sent.
When the serial data sent from the servo amplifier at the downstream side is received via the first connector C1, and the transmission code detection circuit 10 detects the reception of the transmission start code SC, the receive control circuit 11 loads the amplifier data, delimited by 70 bits received after the 60-bit transmission start code SC, into the receive buffer 12.
FIG. 4 shows an example of the system shown in FIG. 1, and indicates the serial data which is output from each amplifier A1, A2 and A3 to the upstream side, where after the local amplifier data DATAn is sent, the amplifier data DATAn+1 and DATAn+2, received from the amplifiers at the downstream side of the local amplifier, are sent. The amplifier A3 sends the transmission start code SC and then the local amplifier data DATA3 to be stored in the amplifier data storage section 13 of the amplifier A3. The amplifier A2 sends the transmission start code SC, the local amplifier data DATA2 to be stored in the amplifier data storage section 13, and then the amplifier data DATA3 received from the amplifier A3 at the downstream side, which is stored in the receive buffer 12. The amplifier A1 sends the transmission start code SC, the amplifier data DATA1 to be stored in the amplifier data storage section 13 of the local amplifier A2, and then the amplifier data DATA2 and DATA3 of the amplifiers at the downstream side sent from the amplifiers at the downstream side, which are stored in the receive buffer 12, in this sequence delimited by 70 bits. Each amplifier can smoothly send receive data from downstream to upstream by matching the transmission start timing.
The data transmitted from the amplifier A1 is data to be received by the numerical controller 1, and the numerical controller 1 as well receives the transmission start code SC and the subsequent amplifier data DATA1 to DATA3 from the amplifier at the downstream side, via a connector C1, which is equivalent to the first connector of the amplifier. The numerical controller 1, however, does not have a connector equivalent to the second connector C2 of the amplifiers, since no servo amplifier or numerical controller exists upstream.
FIG. 5 shows a configuration example of a portion related to the receive circuit to receive the serial data in the conventional numerical controller 1. The transmission start code SC, and then the amplifier data DATA1 to DATA3 from the amplifiers at the downstream side are received from the first connector C1. When the transmission start code SC is detected by a transmission code detection circuit 20, the receive timing of the transmission start code is notified to a receive control circuit 21. The receive control circuit 21 determines the delimits of the data based on the bit position from the transmission start code, and instructs a receive buffer 22 to store the result. By delimiting the receive amplifier data, the amplifier data is caused to correspond to the amplifier.
The data stored in the receive buffer 22 is transferred to a memory, which a control processors for respective axes can refer to, via a data transmission circuit 23, so that the axial control processor for controlling the servo motor driven by each amplifier can be used. At this transfer, a parameter setting storage section 24, which stores parameters indicating a relationship of the sequence of the received amplifier data DATA1 to DATA3 (servo amplifiers) and processors for respective axes, is referred to. Based on the relationship of the sequence of the amplifier data DATA1 to DATA3 (servo amplifiers) and processors for respective axes, which is set by parameter, data is sent to the processors. The example of the parameter setting storage section 24 in FIG. 5 shows that the received data DATA1 from the amplifier A1, which was received first, is transferred to the processor P1, the receive data DATA2 from the amplifier A2, which was received second, is transferred to the processor P2, and the receive data DATA3 from the amplifier A3, which was received third, is transferred to the processor P3.
The example in FIG. 4 shows an ideal state where there is no propagation delay due to the cable 2 between each amplifier. But actually a propagation delay due to the cable 2 does exist, so if this delay time due to the cable 2 is considered, the serial data to be transferred among each amplifier A1, A2 and A3, and between the amplifier A1 and the numerical controller 1, are as shown in FIG. 6.
From each amplifier A1 to A3, the serial data is transmitted at the same transmission start timing. The serial data, which is output from the amplifier A3, is received by the amplifier A2 with a propagation delay due to the cable 2 of the serial bus. The amplifier A2 can transmit the local amplifier data DATA2 and the amplifier data DATA3 of the amplifier A3 at the downstream side, as shown in FIG. 6, if reception of the amplifier data DATA3 from the amplifier A3 at the downstream side is started before completing transmission of the local amplifier data DATA2 after transmission of the transmission start code SC. In the same way, the amplifier A1 can transmit the local amplifier data DATA1 and then the amplifier data DATA2 and DATA3 of the amplifiers A2 and A3, if reception of the amplifier data DATA2 and DATA3 from the amplifier A2 at the downstream side is started before completing transmission of the local amplifier data DATA1.
In this way, the numerical controller 1 sequentially receives the amplifier data DATA1, DATA2 and DATA3 after the transmission start code SC, as shown in FIG. 6.
As described above, according to the prior art, the cable length of the serial bus between the numerical controller and an amplifier and between an amplifier and amplifier, that is between units which transmit/receive data to/from each other, is restricted to be short, so that the delay propagation thereof is small, and data can be transmitted/received normally.
If a propagation delay due to the cable 2 of the serial bus is small, the numerical controller can receive amplifier data from each servo amplifier connected by the daisy chain method, as mentioned above.
But if the cable between each amplifier is long, the delay time, until data transmitted by each amplifier is received by an amplifier or the numerical controller at the upstream side, becomes long, and the data receive timing is sequentially shifted behind, with the result that finally an amplifier which transmitted the local amplifier data cannot make it in time to send the amplifier data of the amplifiers at the downstream side.
FIG. 7 shows an example of serial data transmission/reception timing when the cable between amplifier A1 and amplifier A2 is too long to make it in time to send amplifier data DATA2 and DATA3 of the amplifiers A2 and A3 at the downstream side from the second connector C2 of the amplifier A1 at the upstream side to the numerical controller 1.
The amplifier A1 has not started reception of the amplifier data DATA2 and DATA3 from the amplifier A2 at the downstream side even if transmission of the transmission start code SC and the local amplifier data DATA1 has been completed, because the receive timing of the serial data from the amplifier A2 at the downstream side is too slow, and the amplifier data DATA2 and DATA3 have not been input into the receive buffer 12. Therefore the amplifier data DATA2 and DATA3 of the amplifiers A2 and A3 at the downstream side cannot be transmitted.